package com.kt.sqlProvider;

import org.apache.ibatis.jdbc.SQL;

import java.util.Map;

public class MapperSqlProvider {
    public String selectUserWithParam(Map<String,Object> map) {
        return new SQL(){
            {
                SELECT("*");
                FROM("userinfo");
                for (Map.Entry<String, Object> entry:map.entrySet()){
                    String key = entry.getKey();
                    WHERE(key+"=#{"+key+"}");
                }
            }
        }.toString();
    }
}
